package com.atguigu.gmall.product.service.impl;

import com.atguigu.gmall.product.mapper.BaseTrademarkMapper;
import com.atguigu.gmall.product.model.BaseTrademark;
import com.atguigu.gmall.product.service.BaseTrademarkService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * 品牌表 业务实现类
 * @author atguigu
 * @since 2023-04-18
 */
@Service
public class BaseTrademarkServiceImpl extends ServiceImpl<BaseTrademarkMapper, BaseTrademark> implements BaseTrademarkService {

    /**
     * 分页列表查询
     * @param iPage
     * @return
     */
    @Override
    public Page<BaseTrademark> getBaseTrademarkByPage(Page<BaseTrademark> iPage) {
        //1.设置分页条件
        LambdaQueryWrapper<BaseTrademark> queryWrapper = new LambdaQueryWrapper<>();
        //1.1根据更新时间进行降序排序
        queryWrapper.orderByDesc(BaseTrademark::getUpdateTime);
        //2.调用持久层分页方法
        return this.page(iPage,queryWrapper);
    }

    /**
     * 根据品牌id查询品牌信息
     * @param tmId
     * @return
     */
    @Override
    public BaseTrademark getTrademarkById(Long tmId) {

        return null;
    }
}